package top.ffhome.concurrent.beautiful.ch01;

import cn.hutool.log.Log;
import cn.hutool.log.LogFactory;

public class Demo2Test {
    private static final Log log = LogFactory.get();

    public static void main(String[] args) throws InterruptedException {
        Thread threadOne = new Thread(() -> {
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                log.error(e);
            }
            log.info("child threadOne over!");
        });

        Thread threadTwo = new Thread(() -> {
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                log.error(e);
            }
            log.info("child threadTwo over!");
        });

        threadOne.start();
        threadTwo.start();
        log.info("wait call child thread over!");

        threadOne.join();
        threadTwo.join();
        log.info("all child thread over!");
    }
}
